//
//  WmcAlertSettingGroupView.swift
//  YPWatermarkCamera
//
//  Created by Json on 2023/8/1.
//

import UIKit
import RxRelay

class WmcAlertSettingGroupView: WmcLayoutAlertBaseGroupView {

    /// 图片张数设置
    private lazy var numItemView: WmcAlertSettingPhotoNumItemView = {
        let itemView = WmcAlertSettingPhotoNumItemView()
        return itemView
    }()
    
    var number: Int = 0 {
        didSet {
            numItemView.number = number
        }
    }
    
    /// 点击加号回调
    let addAction: PublishRelay<Void> = .init()
    /// 点击减号回调
    let minusAction: PublishRelay<Void> = .init()
    
    // MARK: UI
    override func makeUI() {
        super.makeUI()
        titleLabel.text = "更多设置"
        stackView.addArrangedSubview(numItemView)
        numItemView.snp.makeConstraints { make in
            make.height.equalTo(52.0.wmc_autoHor)
        }
    }
    
    // MARK: Bind Action
    override func bindViewAction() {
        super.bindViewAction()
        numItemView.addAction.bind(to: addAction).disposed(by: rx.disposeBag)
        numItemView.minusAction.bind(to: minusAction).disposed(by: rx.disposeBag)
    }
}
